<?php



namespace App\Admin\Extensions\Form;

use Encore\Admin\Form\Field;



/**

 * 百度编辑器

 * Class uEditor

 * @package App\Admin\Extensions\Form

 */

class uEditor extends Field

{

    // 定义视图

    protected $view = 'admin.uEditor';



    // css资源

    protected static $css = [];



    // js资源

    protected static $js = [];



    public function render()

    {

        $this->script = <<<EOT
        var ue = UE.getEditor('content');
        ue.ready(function() {
        ue.execCommand('serverparam', '_token', '{{ csrf_token() }}'); // 设置 CSRF token.
    });
EOT;

        return parent::render();

    }

}
